from django.conf.urls.defaults import *

#normal views
urlpatterns = patterns\
			(
				'pacs.views',
				(r'^contest/(?P<contest_id>\d+)/page/(?P<page>\d+)/$','show_contest'),
				(r'^contest/(?P<contest_id>\d+)/$','show_contest'),
				(r'^list/contest/page/(?P<page>\d+)/$','list_contests'),
				(r'^list/contest/$','list_contests'),
				(r'^task/(?P<task_slug>[a-zA-Z0-9_\-]+)/$','show_task'),
				(r'^add/submission/(?P<task_slug>[a-zA-Z0-9_\-]+)/$','add_submission'),
				(r'^add/submission/$','add_submission'),
				(r'^list/submissions/page/(?P<page>\d+)/$','list_submissions'),
				(r'^list/submissions/$','list_submissions'),
				(r'^list/my_submissions/(?P<page>\d+)/$','list_my_submissions'),
				(r'^list/my_submissions/$','list_my_submissions'),
				(r'^submission/(?P<submission_id>\d+)/$','show_submission'),
			)
#ajax views
urlpatterns += patterns\
			(
				'pacs.ajax',
				(r'^ajax/list/contest/page/(?P<page>\d+)/$','list_contests'),
				(r'^ajax/list/contest/$','list_contests'),
				(r'^ajax/list/problem/(?P<problem_id>\d+)/tests/page/(?P<page>\d+)/$','list_tests'),
				(r'^ajax/list/problem/(?P<problem_id>\d+)/tests/$','list_tests'),
			)

#admin views
urlpatterns += patterns\
			(
				'pacs.views',
				(r'^add/full_task/$','add_full_task'),
				(r'^add/contest/$','add_contest'),
				(r'^contest/(?P<contest_id>\d+)/add_task/(?P<task_slug>[a-zA-Z0-9_\-]+)/$','add_task_to_contest'),
				(r'^task/(?P<task_slug>[a-zA-Z0-9_\-]+)/add_goal/$','add_goal'),
				(r'^problem/(?P<problem_id>\d+)/add_test/$','add_test'),
			)

